const db = require("../db/index");
function handleSql(sql, ...arg) {
  return new Promise((resolve, reject) => {
    db.query(sql, [...arg], (err, result) => {
      if (err) return res.error(err.message, 500);
      resolve(result);
    });
  });
}
module.exports = handleSql;
